/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dotexe.webframework.core.collectionsource;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
*
* @author jovan.tomasevic
*/
public class CollectionSource extends JSONObject {

   public CollectionSource() throws JSONException{
       this.put("id", "ruid");
       this.put("sortInfo", new JSONArray());
       this.put("results", 0);
       this.put("fields", new JSONArray());
       this.put("rows", new JSONArray());
   }
   public JSONArray getFields() throws JSONException{
       return (JSONArray) this.getJSONArray("fields");
   }
   public JSONArray getRows() throws JSONException{
       return (JSONArray) this.getJSONArray("rows");
   }

   public int getResults() throws JSONException{
       return this.getInt("id");
   }
   public void setResult(int value) throws JSONException{
       this.put("id", value);
   }

}
